<template>
  <div id="vip">
    <mt-field label="用户名" placeholder="请输入用户名" v-model="username"></mt-field>
    <mt-field label="邮箱" placeholder="请输入邮箱" type="email" v-model="email"></mt-field>
    <mt-field label="密码" placeholder="请输入密码" type="password" v-model="password"></mt-field>
    <mt-field label="手机号" placeholder="请输入手机号" type="tel" v-model="phone"></mt-field>
    <mt-button size="large" type="primary" @click="users">登陆</mt-button>
  </div>
</template>
<script>
export default {
  name:'vip',
  data(){
    return {
      username:'',
      email:'',
      password:'',
      phone:''
    }
  },
  methods:{
    users(){
      window.localStorage.setItem('pro-username',this.username)
      this.$router.push('/vip1')
    }
  },
  beforeRouteEnter (to, from, next) {
    if(localStorage.getItem('pro-username')){
      next("/vip1")
    }else{
      next()
    }
  }
}
</script>
<style lang="css" scope>

</style>
